//
//  UFOLeftViewController.m
//  unrivalledForUniverse
//
//  Created by dllo on 16/1/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UFOLeftViewController.h"
#import "UFOInfoViewController.h"

#import "UFONovelViewController.h"

#import "UFOLQCSkillVCC.h"

@interface UFOLeftViewController ()
@property (nonatomic, retain) UIImageView *imageV;
@property (nonatomic, retain) UIImageView *headImageV;
@property (nonatomic, retain) UIButton *loginB;
@property (nonatomic, retain) UIView *squareV;
@property (nonatomic, retain) UIImageView *lineV;
@property (nonatomic, retain) UIImageView *splitV;
@property (nonatomic, retain) UIButton *collectB;
@property (nonatomic, retain) UILabel *collectL;
@property (nonatomic, retain) UIButton *novelB;
@property (nonatomic, retain) UILabel *novelL;
@property (nonatomic, retain) UIButton *lightB;
@property (nonatomic, retain) UILabel *lightL;
@property (nonatomic, retain) UIView *bottomV;
@property (nonatomic, retain) UIImageView *frontV;
@property (nonatomic, retain) UIImageView *backV;
@property (nonatomic, retain) UIButton *shopB;
@property (nonatomic, retain) UIButton *entertainmenB;
@property (nonatomic, retain) UIButton *skillB;
@property (nonatomic, retain) UILabel *shopL;
@property (nonatomic, retain) UILabel *entertainmenL;
@property (nonatomic ,retain) UILabel *skillL;
@end

@implementation UFOLeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor orangeColor];
    
    [self createSubview];
    [self createButton];
    
    
    
}

- (void)createSubview
{

    self.imageV = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.imageV.image = [UIImage imageNamed:@"zilanse.jpg"];
    [self.view addSubview:self.imageV];
    [self.imageV release];
    
    self.headImageV = [[UIImageView alloc] initWithFrame:CGRectMake(40 * SCREENWIDTH /WIDTHSIXP, 80 * SCREENHEIGHT / HEIGHTSIXP, 60 * SCREENWIDTH /WIDTHSIXP, 60 * SCREENHEIGHT / HEIGHTSIXP)];
    self.headImageV.image = [UIImage imageNamed:@"timo.jpg"];
    self.headImageV.layer.cornerRadius = 30 * SCREENWIDTH / WIDTHSIXP;
    self.headImageV.layer.masksToBounds = YES;
    [self.view addSubview:self.headImageV];
    
    self.squareV = [[UIView alloc] initWithFrame:CGRectMake(0, 200 * SCREENHEIGHT / HEIGHTSIXP, 325 * SCREENWIDTH / WIDTHSIXP, 80 * SCREENHEIGHT / HEIGHTSIXP)];
    self.squareV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:0.320];
    [self.view addSubview:self.squareV];
    [self.squareV release];
    
    self.lineV = [[UIImageView alloc] initWithFrame:CGRectMake(100 * SCREENWIDTH / WIDTHSIXP, 220 * SCREENHEIGHT / HEIGHTSIXP, 2 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP)];
    self.lineV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:1.000];
    [self.view addSubview:self.lineV];
    [self.lineV release];
    
    self.splitV = [[UIImageView alloc] initWithFrame:CGRectMake(220 * SCREENWIDTH / WIDTHSIXP, 220 * SCREENHEIGHT / HEIGHTSIXP, 2 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP)];
    self.splitV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:1.000];
    [self.view addSubview:self.splitV];
    [self.splitV release];
    
    self.bottomV = [[UIView alloc] initWithFrame:CGRectMake(0, 300 * SCREENHEIGHT / HEIGHTSIXP, 325 * SCREENWIDTH /WIDTHSIXP, 80 * SCREENHEIGHT / HEIGHTSIXP)];
    self.bottomV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:0.320];
    [self.view addSubview:self.bottomV];
    [self.bottomV release];
    
    self.frontV = [[UIImageView alloc] initWithFrame:CGRectMake(100 * SCREENWIDTH / WIDTHSIXP, 320 * SCREENHEIGHT / HEIGHTSIXP, 2 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP)];
    self.frontV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:1.000];
    [self.view addSubview:self.frontV];
    [self.frontV release];
    
    self.backV = [[UIImageView alloc] initWithFrame:CGRectMake(220 * SCREENWIDTH / WIDTHSIXP, 320 * SCREENHEIGHT / HEIGHTSIXP, 2 * SCREENWIDTH /WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP)];
    self.backV.backgroundColor = [UIColor colorWithRed:0.528 green:0.513 blue:1.000 alpha:1.000];
    [self.view addSubview:self.backV];
    [self.backV release];
    
    

    
}

- (void)createButton
{

    self.loginB = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.loginB setTitle:@"点击编辑个人资料吧" forState:UIControlStateNormal];
    [self.loginB setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.loginB.titleLabel.font = [UIFont systemFontOfSize:15.0];
    self.loginB.frame = CGRectMake(120 * SCREENWIDTH / WIDTHSIXP, 100 * SCREENHEIGHT / HEIGHTSIXP, 150 * SCREENWIDTH /WIDTHSIXP, 30 * SCREENHEIGHT / HEIGHTSIXP);
    [self.loginB addTarget:self action:@selector(loginBAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.loginB];
    
    self.collectB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.collectB.frame = CGRectMake(25 * SCREENWIDTH /WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50  *SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT /HEIGHTSIXP);
    [self.collectB setImage:[UIImage imageNamed:@"shoucang32"] forState:UIControlStateNormal];
    [self.squareV addSubview:self.collectB];
    
    self.collectL = [[UILabel alloc] initWithFrame:CGRectMake(25 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    self.collectL.text = @"我的收藏";
    self.collectL.textColor = [UIColor whiteColor];
    self.collectL.textAlignment = NSTextAlignmentCenter;
    self.collectL.font = [UIFont systemFontOfSize:12.0];
    [self.squareV addSubview:self.collectL];
    [self.collectL release];
    
    self.novelB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.novelB.frame = CGRectMake(135 * SCREENWIDTH /WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [self.novelB setImage:[UIImage imageNamed:@"novel"] forState:UIControlStateNormal];
    [self.novelB addTarget:self action:@selector(novelBAction) forControlEvents:UIControlEventTouchUpInside];
    [self.squareV addSubview:self.novelB];
    
    self.novelL = [[UILabel alloc] initWithFrame:CGRectMake(135 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    self.novelL.text = @"我的小说";
    self.novelL.textColor = [UIColor whiteColor];
    self.novelL.textAlignment = NSTextAlignmentCenter;
    self.novelL.font = [UIFont systemFontOfSize:12.0];
    [self.squareV addSubview:self.novelL];
    [self.novelL release];
    
    self.lightB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.lightB.frame = CGRectMake(245 * SCREENWIDTH /WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [self.lightB setImage:[UIImage imageNamed:@"yejianmoshi"] forState:UIControlStateNormal];
    [self.squareV addSubview:self.lightB];
    
    self.lightL = [[UILabel alloc] initWithFrame:CGRectMake(245 * SCREENWIDTH / WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT /HEIGHTSIXP)];
    self.lightL.text = @"夜间模式";
    self.lightL.textColor = [UIColor whiteColor];
    self.lightL.textAlignment = NSTextAlignmentCenter;
    self.lightL.font = [UIFont systemFontOfSize:12.0];
    [self.squareV addSubview:self.lightL];
    [self.lightL release];
    
    self.shopB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.shopB.frame = CGRectMake(25 * SCREENWIDTH / WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [self.shopB setImage:[UIImage imageNamed:@"shop"] forState:UIControlStateNormal];
    [self.bottomV addSubview:self.shopB];
    
    self.shopL = [[UILabel alloc] initWithFrame:CGRectMake(25 * SCREENWIDTH /WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    self.shopL.text = @"商城";
    self.shopL.textColor = [UIColor whiteColor];
    self.shopL.textAlignment = NSTextAlignmentCenter;
    self.shopL.font = [UIFont systemFontOfSize:12.0];
    [self.bottomV addSubview:self.shopL];
    [self.shopL release];
    
    self.entertainmenB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.entertainmenB.frame = CGRectMake(135 * SCREENWIDTH /WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [self.entertainmenB setImage:[UIImage imageNamed:@"yule"] forState:UIControlStateNormal];
    [self.bottomV addSubview:self.entertainmenB];
    
    self.entertainmenL = [[UILabel alloc] initWithFrame:CGRectMake(135 * SCREENWIDTH /WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    self.entertainmenL.text = @"娱乐";
    self.entertainmenL.textColor = [UIColor whiteColor];
    self.entertainmenL.textAlignment = NSTextAlignmentCenter;
    self.entertainmenL.font = [UIFont systemFontOfSize:12.0];
    [self.bottomV addSubview:self.entertainmenL];
    [self.entertainmenL release];
    
    
    
    self.skillB = [UIButton buttonWithType:UIButtonTypeCustom];
    self.skillB.frame = CGRectMake(245 * SCREENWIDTH /WIDTHSIXP, 10 * SCREENHEIGHT /HEIGHTSIXP, 50 * SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [self.skillB setImage:[UIImage imageNamed:@"jineng"] forState:UIControlStateNormal];
    [self.skillB addTarget:self action:@selector(skillAction) forControlEvents:UIControlEventTouchUpInside];
    [self.bottomV addSubview:self.skillB];
    
    self.skillL = [[UILabel alloc] initWithFrame:CGRectMake(245 * SCREENWIDTH /WIDTHSIXP, 40 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH /WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    self.skillL.text = @"技能";
    self.skillL.textColor = [UIColor whiteColor];
    self.skillL.textAlignment = NSTextAlignmentCenter;
    self.skillL.font = [UIFont systemFontOfSize:12.0];
    [self.bottomV addSubview:self.skillL];
    [self.skillL release];
    
    
    
}

- (void)skillAction
{
    UFOLQCSkillVCC *skillVC = [[[UFOLQCSkillVCC alloc] init]autorelease];
    
    [self presentViewController:skillVC animated:YES completion:^{
        
        
    }];
    
}

- (void)loginBAction
{

    UFOInfoViewController *infoVC = [[UFOInfoViewController alloc] init];
    [self presentViewController:infoVC animated:YES completion:^{
        
        
    }];
}

- (void)novelBAction
{

    UFONovelViewController * novelVC = [[UFONovelViewController alloc] init];
    [self presentViewController:novelVC animated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
